<?php 
namespace app\api\controller\v1;
use app\api\service\UserService;
use app\api\service\AccountService;
use app\api\service\Token;
use think\Controller;

class Home extends Controller {
    
    // 登陆
    public function login() {
        $service = new UserService;
        return $service->login();
    }

    // 前台登录
    public function userLogin() {
        $service = new AccountService;
        return $service->login();
    }
    // 退出
    public function userLogout() {
        $service = new AccountService;
        return $service->logout();
    }
    public function getToken($code= '') {
        $service = new Token;
        return show(1, 'ok', $service->getToken($code), 200);
    }
}